#include "scaledraw.h"
#include <QDateTime>
#include <QDebug>

ScaleDraw::ScaleDraw()
{
}

/*converts the axis marker texts*/
QwtText ScaleDraw::label(double val) const
{
    QDateTime dt;

    dt.setTime_t(val);                          //convert UNIX-time to normal time
    if(dt.isValid())                            //if val is a time-value
        return QwtText(dt.toString("dd.MM"));   //return a readable time
    else
        return QwtText(QString("%1").arg(val)); //return the value
}
